package com.dataart.training.crimequalification.domain;

import com.dataart.training.crimequalification.entity.FacultativeCrimeObjectEntity;
import com.dataart.training.crimequalification.entity.MainCrimeObjectEntity;
import com.dataart.training.crimequalification.entity.SupplementaryCrimeObjectEntity;

public class CrimeObject {

    //---------------------------------------------------------------

    private MainCrimeObjectEntity crimeObjectEntity;

    private FacultativeCrimeObjectEntity facultativeCrimeObjectEntity;
    private boolean withFacultativeObject;

    private SupplementaryCrimeObjectEntity supplementaryCrimeObjectEntity;
    private boolean withSupplementaryObject;

    //---------------------------------------------------------------

    @Override
    public String toString() {

        StringBuilder sb = new StringBuilder();

        sb.append("Объект преступления: ").
                append("[ Основной объект: ").
                append(crimeObjectEntity.getTextualValue()).
                append(" ] ").
                append("[ Факультативный объект: ");

        if (withFacultativeObject) {
            sb.append(facultativeCrimeObjectEntity.getTextualValue());
        } else {
            sb.append("нет");
        }

        sb.append(" ] [ Дополнительный объект: ");

        if (withSupplementaryObject) {
            sb.append(supplementaryCrimeObjectEntity.getTextualValue());
        } else {
            sb.append("нет");
        }

        sb.append(" ]");

        return sb.toString();

    }

    //---------------------------------------------------------------

    public MainCrimeObjectEntity getCrimeObjectEntity() {
        return crimeObjectEntity;
    }

    public void setCrimeObjectEntity(MainCrimeObjectEntity crimeObjectEntity) {
        this.crimeObjectEntity = crimeObjectEntity;
    }

    public FacultativeCrimeObjectEntity getFacultativeCrimeObjectEntity() {
        return facultativeCrimeObjectEntity;
    }

    public void setFacultativeCrimeObjectEntity(FacultativeCrimeObjectEntity facultativeCrimeObjectEntity) {
        this.facultativeCrimeObjectEntity = facultativeCrimeObjectEntity;
    }

    public SupplementaryCrimeObjectEntity  getSupplementaryCrimeObjectEntity() {
        return supplementaryCrimeObjectEntity;
    }

    public void setSupplementaryCrimeObjectEntity(SupplementaryCrimeObjectEntity  supplementaryCrimeObjectEntity) {
        this.supplementaryCrimeObjectEntity = supplementaryCrimeObjectEntity;
    }

    //---------------------------------------------------------------

    public boolean isWithFacultativeObject() {
        return withFacultativeObject;
    }

    public void setWithFacultativeObject(boolean withFacultativeObject) {
        this.withFacultativeObject = withFacultativeObject;
    }

    public boolean isWithSupplementaryObject() {
        return withSupplementaryObject;
    }

    public void setWithSupplementaryObject(boolean withSupplementaryObject) {
        this.withSupplementaryObject = withSupplementaryObject;
    }
}
